package net.sx.minemodule.mvp.model;

import com.kedll.library.adapter.MultiTypeAdapter;
import com.kedll.library.mvp.BaseItem;
import com.kedll.library.mvp.BaseModel;
import com.kedll.library.util.DateUtil;
import com.kedll.library.util.MyUtils;

import net.sx.minemodule.mvp.item.IntegralInfoItem;

import java.text.SimpleDateFormat;
import java.util.Date;

public class IntegralInfoModel extends BaseModel<IntegralInfoItem> {

    /**
     * createTime :             //时间
     * flag : 0                 //标识 -1 支出 1 收入
     * integralSource :         //积分详情
     * orderSn :                //订单编号
     * point : 0                //积分
     * sourceType : 0           //积分来源 0 签到 1 购物
     */

    private String createTime;
    private int flag;
    private String integralSource;
    private String orderSn;
    private int point;
    private int sourceType;

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getFlag() {
        return flag == 1 ? "收入" : "支出";
    }

    public void setFlag(int flag) {
        this.flag = flag;
    }

    public String getIntegralSource() {
        return integralSource;
    }

    public void setIntegralSource(String integralSource) {
        this.integralSource = integralSource;
    }

    public String getOrderSn() {
        return orderSn;
    }

    public void setOrderSn(String orderSn) {
        this.orderSn = orderSn;
    }

    public String getPoint() {
        return flag == 1 ? "+ " + point : "- " + point;
    }

    public void setPoint(int point) {
        this.point = point;
    }

    public String getSourceType() {
        return sourceType == 0 ? "签到" : "购物";
    }

    public void setSourceType(int sourceType) {
        this.sourceType = sourceType;
    }

    @Override
    public IntegralInfoItem createItem(MultiTypeAdapter adapter) {
        return new IntegralInfoItem(this);
    }
}
